package software_construction.chapter04.d1_fileio.demo2;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;


public class FileReaderTest1 {
    public static void main(String[] args) {
        File file = new File("D:\\untitled\\src\\software_construction\\chapter04\\d1_fileio\\demo1\\student.txt");
        FileReader fileReader = null;
        try {
            fileReader = new FileReader(file);
            int a;
            while ((a = fileReader.read()) != -1) {
                System.out.println((char) a);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                fileReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
